package com.jiazhong.example.project.bookstore.front.controller;

import com.jiazhong.example.project.bookstore.commons.util.JsonResult;
import com.jiazhong.example.project.bookstore.front.service.CategoryService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/category")
public class CategoryController {
    @Resource
    private CategoryService service;

    @GetMapping("/{limit}")
    public JsonResult find(@PathVariable("limit") int limit) {
        return service.findByCategoryLimit(limit);
    }
}
